package com.zy.service;

import org.springframework.stereotype.Service;

@Service   //目标
public class ProductServiceImpl implements ProductService{
    @Override
    public void delete(int pid) {
        System.out.println("删除了pid为"+pid+"的商品");
    }

    @Override
    public int add(String pname, double price) {
//        if( true ) {
//            throw new RuntimeException("添加失败");
//        }
        System.out.println("添加了商品"+pname+",价格为"+price);
        return 1000;
    }

    @Override
    public String findInfo(int pid) {
        return "查询了pid为"+pid+"的商品信息:xxx";
    }
}
